#pragma once

#include <iostream>
#include <string>
#include "../include/prototype.h"
#include "work_experience.h"

class Resum : public Prototype
{
private:
  std::string name_;
  int age_;
  WorkExperiencePtr work_experience_;

public:
  Resum();
  ~Resum();

  void setPersonalInfo(std::string sex, int age);
  void setWorkExperience(std::string time_area, std::string company);
  void displayInfo();
  Resum* clone() override;
};

using ResumPtr = std::shared_ptr<Resum>;

void Resum::setPersonalInfo(std::string name, int age) {
  name_ = name;
  age_ = age;
}

void Resum::setWorkExperience(std::string time_area, std::string company) {
  
  work_experience_->setTimeArea(time_area);
  work_experience_->setCompany(company);
}

void Resum::displayInfo() {
  std::cout << "name: " << name_ << ", age: " << age_ 
      << ", work experience: " << work_experience_->getTimeArea() 
      << " : " << work_experience_->getCompany() << std::endl;
}

Resum* Resum::clone() {
  ResumPtr resum = std::make_shared<Resum>(*this);
  resum->work_experience_ = std::make_shared<WorkExperience>(*work_experience_);
  return resum.get();
}

Resum::Resum() {
  work_experience_ = std::make_shared<WorkExperience>();
}

Resum::~Resum() {
}
